package com.buercorp.wangyu.oop.LambdaDemo;

public class Lambda01 {
    public static void main(String[] args) {
        method(new Swim() {
            @Override
            public void Swimming() {
                System.out.println("正在游泳");
            }
        });

        // Lambda
        method(
                () -> {
                    System.out.println("正在游泳");
                }
        );
    }
    public static void method(Swim s){
        s.Swimming();
    }

    // 接口
    @FunctionalInterface
    interface Swim{
        public abstract void Swimming();
    }
}
